<template>
  <div>
    <div id="container">
      <div id="header">
        <h3>高端深度保洁</h3>
        <div class="top">
          <span>点击定位</span>
          <input type="text" placeholder="搜索服务/店铺" />
          <span class="iconfont fl">&#xe616;</span>
        </div>
        <div class="main">
          <ul>
            <li @click="goShop">
              <div><span class="iconfont">&#xe644;</span></div>
              <span>店铺</span>
            </li>
            <li>
              <div><span class="iconfont">&#xe64f;</span></div>
              <span>都是匠</span>
            </li>
            <li>
              <div><span class="iconfont">&#xe646;</span></div>
              <span>优选</span>
            </li>
            <li @click="goAnswer">
              <div><span class="iconfont">&#xe636;</span></div>
              <span>客服</span>
            </li>
          </ul>
        </div>
      </div>

      <div id="main">
        <ul>
          <li @click="goWash">
            <div>
              <span class="iconfont" style="color: green">&#xe64a;</span>
            </div>
            <span> 保洁清洗</span>
          </li>

          <li @click="goCare">
            <div>
              <span class="iconfont" style="color: orange">&#xe64a;</span>
            </div>
            <span> 保洁月嫂</span>
          </li>

          <li @click="goPipe">
            <div>
              <span class="iconfont" style="color: #1e90ff">&#xe603;</span>
            </div>
            <span>管道疏通</span>
          </li>

          <li @click="goApp">
            <div>
              <span class="iconfont" style="color: #dda0dd">&#xe611;</span>
            </div>
            <span>家电修装</span>
          </li>
        </ul>
      </div>
    </div>
    <template v-show="isShow">
      <router-view v-show="isShow"></router-view>
    </template>
    <MainTarBar v-show="!isShow"/>
  </div>
</template>

<style scoped>
@font-face {
  font-family: "iconfont";
  src: url("../../assets/css/HomePage/font/iconfont.ttf?t=1622553218238")
    format("truetype");
}

.iconfont {
  font-family: "iconfont" !important;
  font-size: 30px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h3 {
  color: #fff;
  margin-top: 8px;
  margin-left: 15px;
  margin-bottom: 5px;
}


#header {
  height: 180px;
  background-color: #64b587;
  font-size: 15px;
  padding-top: 4px;
  width: 375px;
}

#header .top {
  position: relative;
  color: #fff;
  height: 40px;
  line-height: 40px;
  margin-bottom: 10px;
}

#header .top .fl {
  position: absolute;
  top: -22px;
  left: 90px;
  font-size: 20px;
  color: #666;
}

#header span {
  margin: 12px;
  padding-top: 10px;
}

#header input {
  box-sizing: border-box;
  width: 220px;
  margin-left: 10px;
  margin-right: 40px;
  border-radius: 15px;
  outline: none;
  border: none;
  height: 27px;
  padding: 8px 0;
  padding-left: 45px;
}

#header .main {
  color: #fff;
  text-align: center;
}

#header .main ul,
#main ul {
  padding-left: 5px;
}

#header .main ul li,
#main ul li {
  float: left;
  list-style: none;
  margin: 16px;
  font-size: 12px;
}

#header .main ul li div,
#main ul li div {
  margin-bottom: 8px;
}

#main {
  text-align: center;
  width: 375px;
}

#main ul li {
  margin: 20px;
}

#main ul li:last-child {
  margin-right: 10px;
}
</style>

<script>

import MainTarBar from "@/components/content/maintarbar/MainTarBar";
export default {
  data() {
    return {
      isShow: false,
    };
  },
  components:{
    MainTarBar
  },
  methods: {
    handleClick() {
      let container = document.getElementById("container");
      container.style.display = "none";
      this.isShow = true;
      this.$router.push({ name: "list/wash" });
    },
    goWash() {
      this.handleClick();
      this.$router.push({ name: "wash" });
    },
    goCare() {
      this.handleClick();
      this.$router.push({ name: "care" });
    },
    goPipe() {
      this.handleClick();
      this.$router.push({ name: "pipe" });
    },
    goApp() {
      this.handleClick();
      this.$router.push({ name: "appliances" });
    },
    goAnswer() {
      this.handleClick();
      this.$router.push({ name: "Answer" });
    },
    goShop(){
      this.handleClick();
      this.$router.push('home/takeaway');
    }
  },
};
</script>